package vo;

import constant.Constant;

import java.io.Serializable;

public class AjaxResult implements Serializable {
    private String code;
    private String message;
    private Object data;

    public AjaxResult() {
    }

    public AjaxResult(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static AjaxResult success(){
        return success("OK");
    }

    public static AjaxResult success(String message){
        return success(message,null);
    }

    public static AjaxResult success(String message,Object data){
        return new AjaxResult(Constant.AjaxCode.AJAX_CODE_SUCCESS,message,data);
    }

    public static AjaxResult success(Object data){
        return success(null,data);
    }






    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
